#pragma once
#include "SQuadTree.h"
#include "SFrustum.h"
#include "SDebug.h"

class STerrain 
{
public :
	SQuadTree*		m_pQuadTree;
	LPDIRECT3DDEVICE9	m_pd3dDevice;
	SDebug				m_Debug;

public :
	bool	Create( LPDIRECT3DDEVICE9 pd3dDevice, TCHAR* lpBMPFilename = NULL, TCHAR* lpTextFilname = NULL,
		            SFrustum* pFrustum = NULL );
	bool	Init();
	bool	Frame();
	bool	Render();
	bool	Release();
	bool	RestResource();
	bool	RestDevice(){return true;}
	


public :
	LPDIRECT3DVERTEXBUFFER9	m_pVB;
	LPDIRECT3DINDEXBUFFER9	m_pIB;
	LPDIRECT3DTEXTURE9		m_pHeightTexture;
	LPDIRECT3DTEXTURE9		m_pDiffuseTexture;
	P3NCT1VERTEX*			m_pveHeighMap;
	DWORD					m_dwNumFace;
	DWORD					m_dwHeight;
	DWORD					m_dwWidht;

	void	BoundingBoxRender(SQuadTree* pTree);



public:
	STerrain(void);
	virtual~STerrain(void);
};
